package com.cskaoyan.service.impl;

import com.cskaoyan.mapper.MarketGoodsProductMapper;
import com.cskaoyan.model.MarketGoodsProduct;
import com.cskaoyan.service.GoodsProductService;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class GoodsProductServiceImpl implements GoodsProductService {
    @Override
    public void create(SqlSession sqlSession, List<MarketGoodsProduct> products, Integer goodsId) {
        MarketGoodsProductMapper productMapper = sqlSession.getMapper(MarketGoodsProductMapper.class);
        for (MarketGoodsProduct product : products) {
            product.setGoodsId(goodsId);
            productMapper.insertSelective(product);
        }
    }
}
